<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Task (computing)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Task_(computing)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Task_computing rootpage-Task_computing skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Task (computing)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p class="mw-empty-elt">
</p>
<p>In <a href="Computers" class="mw-redirect" title="Computers">computing</a>, a <b>task</b> is a unit of <a href="Execution_(computing)" title="Execution (computing)">execution</a> or a unit of work. The term is ambiguous; precise alternative terms include <i><a href="Process_(computing)" title="Process (computing)">process</a></i>, <a href="Light-weight_process" title="Light-weight process">light-weight process</a>, <i><a href="Thread_(computing)" title="Thread (computing)">thread</a></i> (for execution), <i>step</i>, <i><a href="Request%E2%80%93response" title="Request–response">request</a></i>, or <i>query</i> (for work). In the adjacent diagram, there are <a href="Task_queue" class="mw-redirect" title="Task queue">queues</a> of incoming work to do and outgoing completed work, and a <a href="Thread_pool" title="Thread pool">thread pool</a> of threads to perform this work. Either the work units themselves or the threads that perform the work can be referred to as "tasks", and these can be referred to respectively as requests/responses/threads, incoming tasks/completed tasks/threads (as illustrated), or requests/responses/tasks.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Terminology">Terminology</h2></div>
<p>In the sense of "unit of execution", in some <a href="Operating_system" title="Operating system">operating systems</a>, a task is synonymous with a <a href="Process_(computing)" title="Process (computing)">process</a>, and in others with a <a href="Thread_(computing)" title="Thread (computing)">thread</a>. In non-interactive execution (<a href="Batch_processing" title="Batch processing">batch processing</a>), a task is a unit of execution within a <a href="Job_(computing)" title="Job (computing)">job</a>,<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> with the task itself typically a process. The term "<a href="Computer_multitasking" title="Computer multitasking">multitasking</a>" primarily refers to the processing sense – multiple tasks <i>executing</i> at the same time – but has nuances of the work sense of multiple tasks being <i>performed</i> at the same time.
</p><p>In the sense of "unit of work", in a job (meaning "one-off piece of work") a task can correspond to a single step (the step itself, not the execution thereof), while in <a href="Batch_processing" title="Batch processing">batch processing</a> individual tasks can correspond to a single step of processing a single item in a batch, or to a single step of processing all items in the batch. In online systems, tasks most commonly correspond to a single <i>request</i> (in <a href="Request%E2%80%93response" title="Request–response">request–response</a> architectures) or a <i>query</i> (in <a href="Information_retrieval" title="Information retrieval">information retrieval</a>), either a single stage of handling, or the whole system-wide handling.
</p>
<div class="mw-heading mw-heading3"><h3 id="Examples">Examples</h3></div>
<p>In the <a href="Java_(programming_language)" title="Java (programming language)">Java</a> programming language, these two concepts (unit of work and unit of execution) are conflated when working directly with threads, but clearly distinguished in the <a rel="nofollow" class="external text" href="https://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html">Executors</a> framework:
</p>
<style data-mw-deduplicate="TemplateStyles:r1244412712">
/* start https://en.wikipedia.org/ */
.mw-parser-output .templatequote{overflow:hidden;margin:1em 0;padding:0 32px}.mw-parser-output .templatequotecite{line-height:1.5em;text-align:left;margin-top:0}@media(min-width:500px){.mw-parser-output .templatequotecite{padding-left:1.6em}}
/* end https://en.wikipedia.org/ */
</style><blockquote class="templatequote"><p>When you work directly with threads, a <code>Thread</code> serves as both a unit of work and the mechanism for executing it. In the executor framework, the unit of work and the execution mechanism are separate. The key abstraction is the unit of work, which is called a <i>task</i>.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></p></blockquote>
<div class="mw-heading mw-heading3"><h3 id="IBM_terminology">IBM terminology</h3></div>
<p><a href="IBM" title="IBM">IBM's</a> use of the term has been influential, though underlining the ambiguity of the term, in IBM terminology, "task" has dozens of specific meanings, including:<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>A unit of work representing one of the steps in a process.</li>
<li>A unit of work to be accomplished by a device or process.</li>
<li>A process and the procedures that run the process.</li>
<li>A set of actions designed to achieve a particular result. A task is performed on a set of targets on a specific schedule.</li>
<li>A unit of computation. In a parallel job, two or more concurrent tasks work together through message passing and shared memory. Although it is common to allocate one task per physical or logical processor, the terms "task" and "processor" are not interchangeable.</li>
<li>An activity that has business value, is initiated by a user, and is performed by software.</li></ul>
<p>In <a href="Z/OS" title="Z/OS">z/OS</a> specifically, it is defined precisely as:<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>"In a multiprogramming or multiprocessing environment, one or more sequences of instructions treated by a control program as an element of work to be accomplished by a computer."</li></ul>
<p>The term task in OS/360 through z/OS is roughly equivalent to light-weight process; the tasks in a job step share an address space. However, in <a href="MVS/ESA" class="mw-redirect" title="MVS/ESA">MVS/ESA</a> through z/OS, a task or <a href="Service_Request_Block" title="Service Request Block">Service Request Block</a> (SRB) may have access to other address spaces via its access list.
</p>
<div class="mw-heading mw-heading3"><h3 id="Linux_kernel">Linux kernel</h3></div>
<p>The term <i>task</i> is used in the <a href="Linux_kernel" title="Linux kernel">Linux kernel</a> (at least since v2.6.13,<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> up to and including v4.8<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>) to refer to a unit of execution, which may share various system resources with other tasks on the system. Depending on the level of sharing, the task may be regarded as a conventional <a href="Thread_(computing)" title="Thread (computing)">thread</a> or <a href="Process_(computing)" title="Process (computing)">process</a>. Tasks are brought into existence using the <code>clone()</code> system call,<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> where a user can specify the desired level of resource sharing.
</p>
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>The term <i>task</i> for a part of a job dates to <a href="Multiprogramming" class="mw-redirect" title="Multiprogramming">multiprogramming</a> in the early 1960s, as in this example from 1961:
</p>
<blockquote class="templatequote"><p>The serial model has the ability to process tasks of one job in an independent manner similar to the functioning of the <a href="IBM_709" title="IBM 709">IBM 709</a>.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></p></blockquote>
<p>The term was popularized with the introduction of <a href="OS/360_and_successors" title="OS/360 and successors">OS/360</a> (announced 1964), which featured <a href="OS/360_and_successors#MFT" title="OS/360 and successors">Multiprogramming with a Fixed number of Tasks</a> (MFT) and <a href="OS/360_and_successors#MVT" title="OS/360 and successors">Multiprogramming with a Variable number of Tasks</a> (MVT). In this case tasks were identified with light-weight processes, a job consisted of a number of tasks, and, later, tasks could have sub-tasks (in modern terminology, <a href="Child_process" title="Child process">child processes</a>).
</p><p>Today the term "task" is used very ambiguously. For example, the <a href="Windows_Task_Manager" class="mw-redirect" title="Windows Task Manager">Windows Task Manager</a> manages (running) <i>processes</i>, while <a href="Windows_Task_Scheduler" title="Windows Task Scheduler">Windows Task Scheduler</a> schedules <i>programs</i> to execute in future, what is traditionally known as a <a href="Job_scheduler" title="Job scheduler">job scheduler</a>, and uses the <code>.job</code> extension. By contrast, the term "<a href="Task_queue" class="mw-redirect" title="Task queue">task queue</a>" is commonly used in the sense of "units of work".
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Task_parallelism" title="Task parallelism">Task parallelism</a></li>
<li><a href="Task_queue" class="mw-redirect" title="Task queue">Task queue</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://whatis.techtarget.com/definition/task">"What is task? - Definition from WhatIs.com"</a>. <i>WhatIs.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">June 11,</span> 2015</span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.liutilities.com/articles/what-are-computer-processes/#.VXn8h0b7LDc">"What are computer processes?"</a>. <i>liutilities.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">June 11,</span> 2015</span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFBloch" class="citation book cs1"><a href="Joshua_Bloch" title="Joshua Bloch">Bloch, Joshua</a>. <i>Effective Java</i> (Third ed.). p. <a rel="nofollow" class="external text" href="https://books.google.com/books?id=BIpDDwAAQBAJ&dq=%22the+key+abstraction+is+the+unit+of+work%22&pg=PT431">p. 272</a>, Item 68.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text">IBM Terminology: <a rel="nofollow" class="external text" href="http://www-01.ibm.com/software/globalization/terminology/t.html">T</a></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www-01.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zglossary.doc/zglossary.html">Glossary of z/OS terms and abbreviations</a>: <a rel="nofollow" class="external text" href="http://www-01.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zglossary.doc/zglossary.html#t">T</a></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/torvalds/linux/blob/v2.6.13/include/linux/sched.h">"<code>include/linux/sched.h</code>"</a>. <i>GitHub.com</i>. Linus Torvalds. August 29, 2005.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/torvalds/linux/blob/v4.8/include/linux/sched.h">"<code>include/linux/sched.h</code>"</a>. <i>GitHub.com</i>. Linus Torvalds. October 3, 2016.</cite></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite class="citation journal cs1"><a rel="nofollow" class="external text" href="http://man7.org/linux/man-pages/man2/clone.2.html">"clone, __clone2 - create a child process"</a>. <i>Linux Programmer's Manual</i>. July 17, 2016<span class="reference-accessdate">. Retrieved <span class="nowrap">November 6,</span> 2016</span>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite id="CITEREFJames_Larrimore_McKenney1961" class="citation book cs1">James Larrimore McKenney (1961). <i>Simultaneous multiprogramming of electronic computers</i>. p. <a rel="nofollow" class="external text" href="https://books.google.com/books?id=ThYcAQAAMAAJ&q=%22tasks+of+one+job%22">154</a>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2023-03-17" href="https://en.wikipedia.org/wiki/?title=Task_(computing)&oldid=1145182001">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>